<?php defined('IN_IA') or exit('Access Denied');?><!-- 浏览时长记录 -->
<?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('base/common-header', TEMPLATE_INCLUDEPATH)) : (include template('base/common-header', TEMPLATE_INCLUDEPATH));?>

<!-- 搜索 -->
<form action="<?php  echo aurl('index')?>" method="GET" id="form_search" class="table-top-search form-inline" style="float: right;padding-bottom: 15px">

    <input type="text" name="mch_name" class="form-control" placeholder="搜索所属商家" value="<?php  echo $_GET['mch_name'];?>">
    <input type="text" name="active_name" class="form-control" placeholder="搜索所在活动" value="<?php  echo $_GET['active_name'];?>">
    <?php  echo tpl_form_field_daterange('cav_time',$_GET['cav_time'])?>
    <button class="btn btn-warning" type="submit">搜索</button>&emsp;
    <a class="btn btn-success" style="float:right" href="<?php  echo aurl('exportExcel')?>">导出数据</a>
</form>

<!-- 列表 -->
<form method="post" class="form-horizontal" id="form" name="form" action="<?php  echo aurl?>">

    <table class="table table-hover">
        <tr>
            <th>ID</th>
            <th>用户昵称</th>
            <th>卡券名称</th>
            <th>所属商家</th>
            <th>所在活动</th>
            <th>领取时间</th>
            <th>到期时间</th>
            <th>核销次数</th>
            <th>核销总次数</th>
            <th>卡券状态</th>
            <!-- <th>操作</th> -->
        </tr>
        <?php  if(is_array($ticketdata)) { foreach($ticketdata as $item) { ?>
        <tr>
            <td><?php  echo $item['uni_id'];?></td>
            <td><?php  echo userinfo($item['openid'])['nickname']?></td>
            <td><?php  echo $item['ticket_name'];?></td>
            <td><?php  echo $item['mch_name'];?></td>
            <td><?php  echo $item['active_name'];?></td>
            <td><?php  echo date("Y-m-d H:i:s",$item['get_time'])?></td>
            <td><?php  echo date("Y-m-d H:i:s",$item['end_time'])?></td>
            <td><?php  echo $item['cav_times'];?>次</td>
            <td><?php  echo $item['cav_total'];?>次</td>
            <td><?php  echo $_W['NS']['ticket_users_status'][$item['status']];?></td>
        </tr>
        <?php  } } ?>
    </table>
</form>
<?php  echo $page;?>

<?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('base/common-footer', TEMPLATE_INCLUDEPATH)) : (include template('base/common-footer', TEMPLATE_INCLUDEPATH));?><script>var we7CommonForModule = document.createElement("script");we7CommonForModule.src = '//cdn.w7.cc/we7/w7windowside.js?v=201904260003';document.body.appendChild(we7CommonForModule)
</script>